var t = getApp();

Page({
    data: {
        checked2: !1
    },
    onLoad: function(t) {
        this.getSetting();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    getSetting: function() {
        var e = this, n = t.getNetAddresss("plugin.instation-message.api.message.get-member-set");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                if (1 != n.result) return e.tips(n.msg);
                n.data.disturb && 1 == n.data.disturb && e.setData({
                    checked2: !0
                });
            }
        });
    },
    onShareAppMessage: function() {},
    onChange: function(t) {
        var e = t.detail;
        this.setData({
            checked2: e
        }), this.setSetting();
    },
    setSetting: function() {
        var e = this, n = t.getNetAddresss("plugin.instation-message.api.message.set-member-set");
        t._getNetWork({
            url: n,
            data: {
                disturb: this.data.checked2 ? 1 : 0
            },
            success: function(t) {
                var n = t.data;
                e.tips(n.msg);
            }
        });
    },
    tips: function(t) {
        return wx.showToast({
            title: t,
            icon: "none",
            duration: 2e3
        }), !1;
    }
});